package com.byd.dms.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.byd.dms.enums.Status;
import com.byd.dms.serialize.ListToMapSerializer;
import com.byd.dms.serialize.MapToListDeserializer;
import com.byd.dms.serialize.MapToListSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.LinkedList;
import java.util.List;
import java.util.Map;

//需要导入lombok
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User2 {
    
    private String username;
    private String name;
    private int age;
    private String sex;
    
    public User2(String username, int age, String sex) {
        this.name = username;
        this.age = age;
        this.sex = sex;
    }
    
    private Dept dept;
    
    private List<String> hobbies;
    
    //@JSONField(deserializeUsing  = MapToListDeserializer.class)
    @JSONField(serializeUsing = ListToMapSerializer.class)
    private LinkedList<Dept> map = new LinkedList<>() ;
    
    private Status myStatus;
    
}